<template>
    <el-dialog v-model="show" title="对账" width="20%" align-center @close="handleClose">

        <el-row>
            <el-col class="flex" :span="24">
                <div class="label">
                    外协厂名称：
                </div>
                <div>此处显示的客户名称</div>
            </el-col>
            <el-col class="flex" :span="24">
                <div class="label">
                    摘要：
                </div>
                <div>所属的子公司信息</div>
            </el-col>
            <el-col class="flex" :span="24">
                <div class="label">
                    对账日期：
                </div>
                <div>2024-12-28</div>
            </el-col>
            <el-col class="flex mb10" :span="24">
                <div class="label">
                    加工费总价：
                </div>
                <div>￥5000.00</div>
            </el-col>
        </el-row>
       
        <el-form ref="formRef" :model="form" label-width="100px" >
            <el-form-item label="对账金额：" prop="applyDate">
                <el-input placeholder="请输入对账金额" />
            </el-form-item>
        </el-form>

        <template #footer>
            <div class="dialog-footer">
                <el-button @click="handleClose">取 消</el-button>
                <el-button type="primary" @click="handleSubmit()">确 认</el-button>
            </div>
        </template>
    </el-dialog>
</template>

<script setup lang="ts">
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const props = defineProps(['visible', 'initList']);
const emits = defineEmits(['submit', 'close']);

const show = ref(false);

watch(() => props.visible, async (newValue) => {
    show.value = newValue
    if (newValue) {
    }
}, { deep: true });

const form = reactive({
    applyDate: '',
    applyDepartment: '',
});


const handleSubmit = async () => {
    proxy?.$modal.msgSuccess('操作成功');
    emits('submit', true);

    handleClose();
};


const handleClose = () => {
    emits('close');
};

onMounted(() => {
})
</script>

<style lang="scss" scoped>
.label {
    height: 32px;
    line-height: 32px;
    font-weight: 700;
    display: inline-flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 0 12px 0 0;
    box-sizing: border-box;
    flex: 0 0 auto;
    font-size: var(--el-form-label-font-size);
    color: var(--el-text-color-regular);
    width: 100px;
}

.flex {
    display: flex;
    align-items: center;
}
</style>